$(function(){
	
})

function save(){
	var mainForm = $("#mainForm");
	if(mainForm.isValid()){
		var sex = $(':radio[name="sex"]:checked').val();
		var type = $(':radio[name="type"]:checked').val();
		var data = {
				"USER_NAME"    :$("#user_name").val(),
				"REAL_NAME"    :$("#real_name").val(),
				"ID_CARD_NO"   :$("#id_card_no").val(),
				"WAGE"     	   :$("#WAGE").val(),
				"MEAL_SUB"     :$("#meal_sub").val(),
				"OVER_TIME_SUB":$("#over_time_sub").val(),
				"MOBILE_NO"    :$("#mobile_no").val(),
				"SEX"          :sex,
				"TYPE"         :type
		}
		$.jsonAjax("userServlet","addUserInfo",data,null,false,function(rtnData){
			if(!isEmpty(rtnData)&&rtnData.data.status=="success"){
				if(rtnData.data.content.rtnCode=="success"){
					art.dialog.message("succeed",rtnData.data.content.rtnMsg,function(){
						art.dialog.open.api.close();
						art.dialog.open.origin.queryListData();
					});
				} else{
					art.dialog.message("error",rtnData.data.content.rtnMsg,null);
				}
				
			} else{
				art.dialog.message("error","新增用户失败！",null);
			}
		});
	} 
}

function cancel(){
	art.dialog.open.api.close();
}